
import { FormState } from "./ChartForm";
import { ChartFormItemContext } from "./ChartFormItem";
import { EChartFormItem, EMateDataType, IChartFormItem, TuseComputedFn } from "./ChartItemType";
import { useFormState, useFormComputed, useFormCommonItems } from "./ActiveChartForm"
export default function AriesForm() {
    const titleExp = useFormState({
        label: "标题文字",
        value: "",
        placeHolder: "请输入图表标题",
        // name: "explorer",
        datas: "",
        type: EChartFormItem.Input
    });
    const description = useFormState({
        label: "图表备注",
        value: "",
        placeHolder: "请输入图表备注内容",
        // name: "description",
        datas: "",
        type: EChartFormItem.Input
    });
    const textForm = useFormState({
        label: "内容",
        value: "",
        placeHolder: "请选择内容数据列",
        // name: "textForm",
        datas: "",
        type: EChartFormItem.Select,
        mateData: {
            type: EMateDataType.ALL
        }
    });

    const text = useFormComputed([textForm], () => {
        const textColumn = textForm.data;
        return `return $originData[0]['${textColumn}']`;
    });
    return {
        titleExp,
        description,
        textForm,
        text
    }
}
